const WebSocket = require('ws');

const wsUrl = 'ws://118.31.119.10:8081/ws/86574923'

const ws = new WebSocket(wsUrl);

ws.on('open', function open() {
    ws.send('something');
    console.log('ws client : %s', wsUrl);
});

ws.on('message', function message(data) {
    console.log('received: %s', data);
});

ws.on('close', function close(data) {
    console.log('close', data);
});

ws.on('error', function error(data) {
    console.log('close', data);
});
